import React, { useState } from 'react'
import { useNavigate } from 'react-router-dom'

const Mylogin = () => {
    const [istor, setIstor] = useState(false)
    const token = localStorage.getItem('token')
    const nav = useNavigate()
    if (token) {
        setIstor(true)
    }
    else {
        setIstor(false)
        nav('/login')
    }
    return { istor: istor }

}

export default Mylogin
